package de.unifa.elostplugin;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class ElostPluginLogger {

	
	private Activator plugin;
	private ILog logger;

	public ElostPluginLogger() {
		this.plugin = Activator.getDefault();
	    this.logger = plugin.getLog();
	}
	
	
	public boolean isDebugEnabled(){
		
		return plugin.isDebugging();
	}
	
	
	public void logDebug(String message){
		IStatus statusDebug = new Status(IStatus.INFO, Activator.PLUGIN_ID, message); 
		logger.log(statusDebug);
	}
	
	public void logWarning(String message){
		IStatus statusDebug = new Status(IStatus.WARNING, Activator.PLUGIN_ID, message); 
		logger.log(statusDebug);
		
	}
	
	public void logException(Throwable ex){
		IStatus statusError = new Status(IStatus.ERROR,Activator.PLUGIN_ID,ex.getMessage(),ex);
		logger.log(statusError);
	}
	
	
}
